package com.example.springbootdemo.异步注解失效测试.controller;


import com.example.springbootdemo.异步注解失效测试.service.PrintTwo;
import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.web.bind.annotation.RequestMapping;
import org.springframework.web.bind.annotation.RequestMethod;
import org.springframework.web.bind.annotation.RestController;

@RestController
@RequestMapping("async2")
public class Async2Controller {

    @Autowired
    PrintTwo printTwo;

    @RequestMapping(method = RequestMethod.GET,value = "one")
    public String test1() {
        printTwo.java();
        System.out.println("主线程名"+ Thread.currentThread().getName());
        return "方法返回值";
    }
    @RequestMapping(method = RequestMethod.GET,value = "two")
    public String test2() {
        printTwo.python();
        System.out.println("主线程名"+ Thread.currentThread().getName());
        return "方法返回值";
    }
}
